#include <iostream>
using namespace std;
class A {
public:
	friend class B;//B类是A类的好朋友，在B类可以访问A类的私有成员 私有函数
	//声明位置和public private没有关系
	friend void modifyA(A *pA, int _a);//函数modifyA是类A的好朋友
	A(int a=0,int b=0) {
		this->a = a;
		this->b = b;
	}
	int getA() {
		return this->a;
	}
private:
	int a;
	int b;
	
};
void modifyA(A *pA,int _a) {
	pA->a = _a;
}
class B {
public:
	void Set(int a) {
		Aobject.a = a;
	}
	void printB() {
		cout << Aobject.a << endl;
	}
private:
	A Aobject;
};
void main01() {
	/*A a1(1, 2);
	modifyA(&a1,300);
	cout << a1.getA() << endl;*/
	B b1;
	b1.Set(300);
	b1.printB();

	cout << "fsdfds" << endl;

}